<div class="title"><?php echo $pageTitle ?></div>
<hr />
<div id="form_entry_lokasi">
    <?
    switch ($page2) {
        case "reg" :
            ?>
            <div><a href="<?php echo site_url("master/add_reg/reg") ?>"><img src="<?php echo res_url("img/add_icon_24.PNG"); ?>" alt="Add New Region"  title="Add New Region"/></a></div><br />  
            <table width="100%" style="border-collapse:collapse; border:1px solid #CCCCCC" border="1">
                <tr bgcolor="#00FF00">
                    <th>No</th><th>Kode</th><th align="left">Nama Region</th><th>Aksi</th>       
                </tr>
                <?
                $no = 1;
                foreach ($arrayreg as $row) {
                    ?>
                    <tr>
                        <td align="center" width="10"><?= $no ?>&nbsp;&nbsp;</td>
                        <td width="50"><?= $row->code; ?></td>        
                        <td><?= $row->display_name; ?></td>
                        <td width="50"><a href="<?php echo site_url("master/edit_reg/reg/" . $row->id) ?>"><img src="<?php echo res_url("img/edit_icon_16.PNG"); ?>" alt="Edit"  title="Edit"/></a> | <a href="<?php echo site_url("master/del_reg/reg/" . $row->id) ?>"><img src="<?php echo res_url("img/delete_icon_16.PNG"); ?>" alt="Delete"  title="Delete"/></a></td>
                    </tr> 
                    <? $no++;
                } ?>   
            </table> 
            <?
            break;
        case "prov" :
            ?>
            <div><a href="<?php echo site_url("master/add_reg/prov") ?>"><img src="<?php echo res_url("img/add_icon_24.PNG"); ?>" alt="Add New Propinsi"  title="Add New Propinsi"/></a></div> <br />
            <table width="100%" style="border-collapse:collapse; border:1px solid #c0c0c0" border="1">
                <tr bgcolor="#00FF00">
                    <th>No</th><th>Kode</th><th align="left">Nama Propinsi</th><th>Aksi</th>       
                </tr>
                <?
                $no = 1;
                foreach ($arrayreg as $row) {
                    ?>
                    <tr>
                        <td align="center" width="10"><?= $no ?>&nbsp;&nbsp;</td>
                        <td width="50"><?= $row->code; ?></td>        
                        <td><?= $row->display_name; ?></td>
                        <td width="50"><a href="<?php echo site_url("master/edit_reg/prov/" . $row->id) ?>"><img src="<?php echo res_url("img/edit_icon_16.PNG"); ?>" alt="Edit"  title="Edit"/></a> | <a href="<?php echo site_url("master/del_reg/prov/" . $row->id) ?>"><img src="<?php echo res_url("img/delete_icon_16.PNG"); ?>" alt="Delete"  title="Delete"/></a></td>
                    </tr> 
                <? $no++;
            } ?>   
            </table> 
            <?
            break;
        case "kab" :
            ?>
            <div><a href="<?php echo site_url("master/add_reg/kab") ?>"><img src="<?php echo res_url("img/add_icon_24.PNG"); ?>" alt="Add New Kabupaten"  title="Add New Kabupaten"/></a></div><br />
            <table width="100%" style="border-collapse:collapse; border:1px solid #c0c0c0" border="1">
                <tr bgcolor="#00FF00">
                    <th>No</th><th>Kode</th><th align="left">Nama Kabupaten</th><th>158</th><th>84</th><th>Latitude</th><th>Longlatitude</th><th>Aksi</th>       
                </tr>
                <?
                $no = 1;
                foreach ($arrayreg as $row) {
                    ?>
                    <tr>
                        <td align="center" width="10"><?= $no ?>&nbsp;&nbsp;</td>
                        <td width="50"><?= $row->code; ?></td>        
                        <td><?= $row->display_name; ?></td>
                        <td width="20"><? if ($row->is_tertinggal == 0) {
                        echo "<img src=" . res_url('img/no-icon_16.PNG') . " >";
                    } else {
                        echo "<img src=" . res_url('img/ya-icon_16.PNG') . " >";
                    } ?></td>
                        <td width="20"><? if ($row->is_tertinggal84 == 0) {
                echo "<img src=" . res_url('img/no-icon_16.PNG') . " >";
            } else {
                echo "<img src=" . res_url('img/ya-icon_16.PNG') . " >";
            } ?></td>
                        <td width="80" align="right"><?= $row->latitude; ?></td>
                        <td width="80" align="right"><?= $row->longlatitude; ?></td>
                        <td width="50"><a href="<?php echo site_url("master/edit_reg/kab/" . $row->id) ?>"><img src="<?php echo res_url("img/edit_icon_16.PNG"); ?>" alt="Edit"  title="Edit"/></a> | <a href="<?php echo site_url("master/del_reg/kab/" . $row->id) ?>"><img src="<?php echo res_url("img/delete_icon_16.PNG"); ?>" alt="Delete"  title="Delete"/></a></td>
                    </tr> 
                    <? $no++;
                } ?>   
            </table> 
                <?
                break;
            case "kec" :
                ?>
            <div><a href="<?php echo site_url("master/add_reg/kec") ?>"><img src="<?php echo res_url("img/add_icon_24.PNG"); ?>" alt="Add New Kecamatan"  title="Add New Kecamatan"/></a></div><br />
            <table width="100%" style="border-collapse:collapse; border:1px solid #c0c0c0" border="1">
                <tr bgcolor="#00FF00">
                    <th>No</th><th>Kode</th><th align="left">Nama Kecamatan</th><th>Latitude</th><th>Longlatitude</th><th>Aksi</th>       
                </tr>
                <?
                $no = 1;
                foreach ($arrayreg as $row) {
                    ?>
                    <tr>
                        <td align="center" width="10"><?= $no ?>&nbsp;&nbsp;</td>
                        <td width="50"><?= $row->code; ?></td>        
                        <td><?= $row->display_name; ?></td>
                        <td width="80" align="right"><?= $row->latitude; ?></td>
                        <td width="80" align="right"><?= $row->longlatitude; ?></td>
                        <td width="50"><a href="<?php echo site_url("master/edit_reg/kec/" . $row->id) ?>"><img src="<?php echo res_url("img/edit_icon_16.PNG"); ?>" alt="Edit"  title="Edit"/></a> | <a href="<?php echo site_url("master/del_reg/kec/" . $row->id) ?>"><img src="<?php echo res_url("img/delete_icon_16.PNG"); ?>" alt="Delete"  title="Delete"/></a></td>
                    </tr> 
                    <? $no++;
                } ?>   
            </table> 
                <?
                break;
            case "desa" :
                ?>
            <div><a href="<?php echo site_url("master/add_reg/desa") ?>"><img src="<?php echo res_url("img/add_icon_24.PNG"); ?>" alt="Add New Desa"  title="Add New Desa"/></a></div><br />
            <table width="100%" style="border-collapse:collapse; border:1px solid #c0c0c0" border="1">
                <tr bgcolor="#00FF00">
                    <th>No</th><th>Kode</th><th align="left">Nama Desa</th><th>Latitude</th><th>Longlatitude</th><th>Aksi</th>       
                </tr>
                <?
                $no = 1;
                foreach ($arrayreg as $row) {
                    ?>
                    <tr>
                        <td align="center" width="10"><?= $no ?>&nbsp;&nbsp;</td>
                        <td width="50"><?= $row->code; ?></td>        
                        <td><?= $row->display_name; ?></td>
                        <td width="80" align="right"><?= $row->latitude; ?></td>
                        <td width="80" align="right"><?= $row->longlatitude; ?></td>
                        <td width="50"><a href="<?php echo site_url("master/edit_reg/desa/" . $row->id) ?>"><img src="<?php echo res_url("img/edit_icon_16.PNG"); ?>" alt="Edit"  title="Edit"/></a> | <a href="<?php echo site_url("master/del_reg/desa/" . $row->id) ?>"><img src="<?php echo res_url("img/delete_icon_16.PNG"); ?>" alt="Delete"  title="Delete"/></a></td>
                    </tr> 
            <? $no++;
        } ?>   
            </table> 
        <?
        break;
}
?>
</div>